import { SerializeStream } from "../../Framework/Serialize/SerializeStream";
import { SUrl } from "./SUrl";
//class SeqUrlHelper

export class SeqUrlHelper {
  public static write(stream: SerializeStream, arg2: Array<SUrl>): void {
    if (arg2 != null) {
      stream.writeSize(arg2.length);
      var i = 0;
      while (i < arg2.length) {
        arg2[i].__write(stream);
        ++i;
      }
    } else {
      stream.writeSize(0);
    }
    return;
  }

  public static read(arg1: SerializeStream): Array<SUrl> {
    var loc4 = null;
    var size = arg1.readSize();
    arg1.startSeq(size, 5);
    var ret = new Array<SUrl>();
    var loc3 = 0;
    while (loc3 < size) {
      (loc4 = new SUrl()).__read(arg1);
      ret[loc3] = loc4;
      arg1.checkSeq();
      arg1.endElement();
      ++loc3;
    }
    arg1.endSeq(size);
    return ret;
  }
}
